<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			分数：{{message}}
			<my-component @click_Adds="CountNum" :num="this.message"></my-component>
		</div>
		<script src="js/vue2.5.js"></script>
		<script>
			var vm = new Vue({
				el:'#app',
				data:{
					message:0
				},
				methods:{
					CountNum:function(msg){
						this.message = msg;
					}
				},
				components:{
					'my-component':{
						props:['num'],
						template:'<button @click="add">+</button>',
						data(){
							return{
								count:this.num
							}
						},
						methods:{
							add:function(){
								this.count++;
								this.$emit('click_Adds',this.count);
							}
						}
					}
				}
			})
		</script>
	</body>
</html>
